package com.cloud.salon.common.base.entity.business;

import com.cloud.salon.common.base.entity.BaseEntity;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

/**
 * @Description 理发记录
 * @Author wolf--LZH
 * @CreateDate 2019/4/21 0021 下午 7:36
 */
@Data
@Entity
@Table(name="record")
public class Record extends BaseEntity {

    // 顾客
    private Integer accountId;
    // 操作员工
    @Column(nullable = false)
    private Integer staffId;

    // 理发记录日期
    @Column(nullable = false, length = 50)
    private Date date;
    // 总应付金额
    @Column(nullable = false)
    private Double totalPrice;
    // 订单状态
    @Column(nullable = false)
    private Integer status;

//    // 所办理的项目列表
//    @ManyToMany(fetch = FetchType.EAGER)
//    @JoinTable(
//            name = "record_item",
//            joinColumns = {@JoinColumn(name = "record_id", referencedColumnName = "id")},
//            inverseJoinColumns = {@JoinColumn(name = "item_id", referencedColumnName = "id")})
//    @Fetch(FetchMode.SUBSELECT)
//    private List<Item> items;

//    @OneToMany(fetch = FetchType.EAGER)
//    @JoinTable(
//            name = "record_payment",
//            joinColumns = {@JoinColumn(name = "record_id", referencedColumnName = "id")},
//            inverseJoinColumns = {@JoinColumn(name = "payment_id", referencedColumnName = "id")})
//    @Fetch(FetchMode.SUBSELECT)
//    private List<Payment> payments;
}
